﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Nutrapp.DBAL;

namespace Nutrapp.Models
{
    public class IngredientModel
    {

        public IEnumerable<Ingredients_Category> ingredient { get; set; }

        public int ID { get; set; }
        public String Name { get; set; }
        public int Category { get; set; }


        public List<String> GetCategory()
        {
            NutrappDataContext context = new NutrappDataContext();
            List<Ingredients_Category> ingrCat = context.Ingredients_Categories.ToList();
            List<String> categoryList = new List<string>();
            foreach (var item in ingrCat)
            {
                categoryList.Add(item.Name);

            }
            return categoryList;
        }
    }
}